/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mygame;

import com.jme3.cinematic.MotionPath;
import com.jme3.math.Spline;
import java.util.ArrayList;
import java.util.Random;

/**
 *
 * @author 100350
 */
public class MyPath extends MotionPath {
    private ArrayList<MyPath> neighbors;
    
    MyPath(){
        neighbors = new ArrayList<MyPath>();
        setPathSplineType(Spline.SplineType.Linear);
    }
    
    public MyPath getNext(){
        Random generator = new Random(); 
        int max = neighbors.size();
        int i = generator.nextInt(max); 
        return neighbors.get(i);
    }
    
    public void addNeighbor(MyPath neighbor){
        neighbors.add(neighbor);
    }
}
